home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Freeware / DiskMaster / Rexx / DMIntCmtAll.rexx < prev    next >
OS/2 REXX Batch file  |  2002-10-27  |  789b  |  49 lines

  1. /* $VER: DMCmtAll.rexx 1.1 (2.10.97) By J. Tierney
  2.  
  3.   DiskMaster II Comment All  v1.1
  4.   10/2/97  J. Tierney
  5.  
  6.   Function:  All selected files recieve the same comment.
  7.  
  8.   Usage:  DMCmtAll.rexx
  9.  
  10. */
  11.  
  12. OPTIONS RESULTS
  13.  
  14. CONFIRM 'Comment:' 'Okay' 'Cancel' '" "'
  15. comment = result
  16. comment = FixQuotes(comment)
  17. comment = '"' || comment || '"'
  18.  
  19. STATUS P
  20. dir = result
  21. PRAGMA('D', dir)
  22. ADDRESS COMMAND 'C:Echo >T:txt' dir
  23.  
  24. DIRLIST VAR dlist SEL
  25. DO i = 1 TO dlist.name.0
  26.   ADDRESS COMMAND 'C:FileNote' dlist.name.i comment
  27. END
  28.  
  29. DESELECT '*'
  30. NEWDIR dir
  31. EXIT 0
  32.  
  33.  
  34. /* Procedures */
  35.  
  36. FixQuotes: PROCEDURE
  37.   PARSE ARG string
  38.   x = 1
  39.   DO FOREVER
  40.     x = POS('"', string, x)
  41.     IF x ~= 0 THEN
  42.       DO
  43.         string = INSERT('*', string, x - 1)
  44.         x = x + 1
  45.       END
  46.     ELSE LEAVE
  47.   END
  48. RETURN string
  49.